package org.serviceImpl;

import org.dao.FloorDao;
import org.dao.ThreadDao;
import org.model.Floor;
import org.model.Thread;
import org.service.ForumService;

import java.util.List;

/**
 * Created by tedzy on 2015/5/14.
 * forum service
 */
public class ForumServiceImpl implements ForumService {
    ThreadDao threadDao;
    FloorDao floorDao;

    @Override
    public int newThread(String title) {
        return threadDao.newThread(title);
    }

    @Override
    public boolean addFloor(int threadId, int floorId) {
        return threadDao.addFloor(threadId, floorId);
    }

    @Override
    public Thread readThread(int id) {
        return threadDao.readThread(id);
    }

    @Override
    public int newFloor(int threadId, int uid, String content) {
        return floorDao.newFloor(threadId, uid, content);
    }

    @Override
    public int newInFloor(int floorId, int uid, String content) {
        return floorDao.newInFloor(floorId, uid, content);
    }

    @Override
    public boolean addInFloor(int parentFloor, int inFloor) {
        return floorDao.addInFloor(parentFloor, inFloor);
    }

    @Override
    public List<Floor> readFloors(String floorsCsv) {
        return floorDao.readFloors(floorsCsv);
    }

    @Override
    public List<Thread> getThreads() {
        return threadDao.getThreads();
    }

    @Override
    public int incZan(int floorId) {
        return floorDao.incZan(floorId);
    }

    public ThreadDao getThreadDao() {
        return threadDao;
    }

    public void setThreadDao(ThreadDao threadDao) {
        this.threadDao = threadDao;
    }

    public FloorDao getFloorDao() {
        return floorDao;
    }

    public void setFloorDao(FloorDao floorDao) {
        this.floorDao = floorDao;
    }
}
